import React, {Component} from 'react';

class App extends Component {
    constructor() {
        super();
        this.state={
            message:'测试文字显示',
            flag:false
        }
    }
    changeText(){
        this.setState({
            message:'更新了'
        })
    }
    render() {
        const { message } = this.state
        return (
            <div>
                <h1>{message}</h1>
                <button onClick={e=>this.changeText()}>按钮改变文字</button>

                <button></button>
            </div>
        );
    }
}

export default App;
